<?php

/**
 * @Project NUKEVIET 3.3
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 - 2011 VINADES.,JSC. All rights reserved
 * @Createdate Sat, 10 Dec 2011 06:46:54 GMT
 */

if (! defined ( 'NV_ADMIN' ) or ! defined ( 'NV_MAINFILE' ) or ! defined ( 'NV_IS_MODADMIN' ))
	die ( 'Stop!!!' );
define ( 'NV_IS_FILE_ADMIN', true );
$submenu ['user_add'] = $lang_module ['user_add'];
$submenu ['user_waiting'] = $lang_module ['member_wating'];
$submenu ['groups'] = $lang_global ['mod_groups'];
$submenu ['question'] = $lang_module ['question'];
$submenu ['siteterms'] = $lang_module ['siteterms'];
$submenu ['config'] = $lang_module ['config'];
$allow_func = array (
		'main',
		'del',
		'delconfirm',
		'setactive',
		'user_add',
		'edit',
		'user_waiting',
		'delawaitinglist',
		'question',
		'siteterms',
		'config',
		'groups',
		'getuserid' 
);
function groupList() {
	global $db;
	$query = "SELECT * FROM `" . NV_GROUPS_GLOBALTABLE . "` ORDER BY `weight`";
	$result = $db->sql_query ( $query );
	$groups = array ();
	while ( $row = $db->sql_fetchrow ( $result ) ) {
		$groups [$row ['group_id']] = $row;
	}
	return $groups;
}
function nv_fix_question() {
	global $db;
	$query = "SELECT `qid` FROM `" . NV_USERS_GLOBALTABLE . "_question` WHERE `lang`='" . NV_LANG_DATA . "' ORDER BY `weight` ASC";
	$result = $db->sql_query ( $query );
	$weight = 0;
	while ( $row = $db->sql_fetchrow ( $result ) ) {
		++ $weight;
		$sql = "UPDATE `" . NV_USERS_GLOBALTABLE . "_question` SET `weight`=" . $weight . " WHERE `qid`=" . $row ['qid'];
		$db->sql_query ( $sql );
	}
	$db->sql_freeresult ();
}

?>